package com.feige.constant;

/**
 * @author feige
 */
public interface Constants {

    /**
     * 分页参数名称
     */
    String PAGE_SIZE_NAME = "pageSize";
    String PAGE_NUM_NAME = "pageNum";

    /**
     * 统一返回结果对应值标志
     */
    String CODE_TAG = "code";
    String MSG_TAG = "msg";
    String DATA_TAG = "data";
    String PAGES_TAG = "pages";
    String TOTAL_TAG = "total";
    /**
     * 枚举状态码和提示信息
     */
    int SUCCESS_CODE = 200;
    int ERROR_CODE = 500;
    String SUCCESS_MSG = "success";
    String ERROR_MSG = "error";
    /**
     * jwt秘钥
     */
    String APP_SECRET = "ukc8BDbRigUDaY6pZFfWus2jZWLPHO";
    /**
     * token
     */
    String TOKEN_KEY = "Authorization";
    String TOKEN_PREFIX = "Bearer";
    int TOKEN_EXPIRE = 7 * 24 * 60 * 60;
    /**
     * 登录用户key
     */
    String LOGIN_USER_KEY = "login_user:";

    /**
     * 某个群的用户key
     */
    String GROUP_USER_ID_KEY = "group_user_id_key:";
    /**
     * 某个班级key
     */
    String CLASS_KEY = "class_key:";

    /**
     * 某个课程key
     */
    String COURSE_KEY = "course_key:";

    /**
     * 轮播图数据的key
     */
    String SWIPER_KEY = "swiper_key:";

    /**
     * 对应二维码的前缀
     */
    String COURSE_QR_CODE_URL_PREFIX = "feige:course:";
    String SIGN_QR_CODE_URL_PREFIX = "feige:sign:";
    String CLAZZ_QR_CODE_URL_PREFIX = "feige:clazz:";

    /**
     * 验证码key,验证码过期时间
     */
    String CAPTCHA_CODE_KEY = "captcha:";
    long CAPTCHA_CODE_EXPIRE = 5*60L;
    String EMAIL_CODE_KEY = "email:";

    /**
     * key过期时间
     */
    long KEY_EXPIRE = TOKEN_EXPIRE / 2;

    /**
     * token过期相差小于20分钟则刷新缓存
     */
    long TWENTY_MINUTE = 20 * 60L;


    /**
     * 自定义异常码
     */
    Integer CAPTCHA_ERROR = 5079;
    Integer CAPTCHA_EXPIRE = 5063;
    Integer USER_NOT_FOUND = 5000;
    Integer USER_DISABLE = 4002;


    /**
     * 每页大小
     */
    Long PAGE_SIZE = 10L;
    String PAGE_SIZE_STR = "10";

    /**
     * 聊天消息每页大小
     */
    Integer CHAT_MSG_PAGE_SIZE = 20;

    /**
     * 聊天用户每页大小
     */
    Integer CHAT_USER_PAGE_SIZE = 10;


    /**
     * 允许上传图片和语音格式
     */
    String[] OFFICE_FILE_TYPE = {"pdf","doc","docx","ppt","pptx","xls","xlsx"};
    String[] IMG_TYPE = {"png", "jpg", "jpeg", "webp", "gif"};
    String[] BASE64_TYPE = {"data:image/jpeg;","data:image/x-icon;","data:image/gif;","data:image/png;"};
    String BLOB = "BLOB";
    String[] VOICE_TYPE = {"mp3"};
    String[] AUDIO_TYPE = {"mp4"};
    String PDF_TYPE = "pdf";
    String[] EXCEL_TYPE = {"xls","xlsx"};
    String[] WORD_TYPE = {"docx","ppt"};
    String[] PPT_TYPE = {"ppt","pptx"};
    String HTML_TYPE = "html";
    String TXT_TYPE = "txt";
    String MD_TYPE = "md";
    String[] ZIP_TYPE = {"zip","jar","rar"};
    String[] FILE_TYPE = {"pdf","doc","docx","ppt","pptx","xls","xlsx"};


    /**
     * 服务名
     */
    String XIAOFEI_CLOUD_CLASSROOM_CHAT = "XIAOFEI-CLOUD-CLASSROOM-CHAT";
    String XIAOFEI_CLOUD_CLASSROOM_COURSE = "XIAOFEI-CLOUD-CLASSROOM-COURSE";

}

